package com.sunnada.edu.business.pieceApply.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;

@Repository
public class PieceApplyDaoImpl extends BaseDaoImpl implements PieceApplyDao {

	@Override
	public int getExitSettlementCots(HashMap<String, String> params) {
		List list = selectList("pieceApply_sqlmap.getExitSettlementCots", params);
		if (list != null && list.size() > 0) {
			String cot = ((Map) list.get(0)).get("COT") + "";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findExitSettlement(HashMap<String, String> params) {
		return selectList("pieceApply_sqlmap.findExitSettlement", params);
	}

	@Override
	public int attendanceDelete(HashMap<String, String> params) {
		return delete("pieceApply_sqlmap.attendanceDelete", params);
	}

	@Override
	public int attenRecordAdd(HashMap<String, String> params) {
		return insert("pieceApply_sqlmap.attenRecordAdd", params);
	}

	@Override
	public int attendanceUpdate(HashMap<String, String> params) {
		return update("pieceApply_sqlmap.attendanceUpdate", params);
	}

	@Override
	public Map attendanceByRecId(HashMap<String, String> params) {
		List list = selectList("pieceApply_sqlmap.attendanceByRecId", params);
		if (list != null && list.size() > 0) {
			return (Map) list.get(0);
		}
		return null;
	}
	
	@Override
	public List<?> exportAttendance(HashMap<String, String> params) {
		return selectList("pieceApply_sqlmap.exportAttendance", params);
	}

	@Override
	public int exitpayApply(HashMap<String, String> params) {
		return insert("pieceApply_sqlmap.exitpayApply", params);
	}

	@Override
	public int insertExitpayApplyWorkers(List<HashMap<String, String>> list) {
		return insert("pieceApply_sqlmap.insertExitpayApplyWorkers", list);
	}

	@Override
	public List<?> getPieceApplyByRecid(HashMap<String, String> params) {
		return selectList("pieceApply_sqlmap.getPieceApplyByRecid", params);
	}

	@Override
	public int getPieceApplyWorkerCots(HashMap<String, String> params) {
		List list = selectList("pieceApply_sqlmap.getPieceApplyWorkerCots", params);
		if (list != null && list.size() > 0) {
			String cot = ((Map) list.get(0)).get("COT") + "";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findPieceApplyWorker(HashMap<String, String> params) {
		return selectList("pieceApply_sqlmap.findPieceApplyWorker", params);
	}

}
